package com.ecoolex.discount.sales.enums;

import com.ecoolex.framework.common.EnumInterface;
import com.ecoolex.framework.common.util.Check;

public enum DiscountProductDynamicShelfLifeType implements EnumInterface<DiscountProductDynamicShelfLifeType, Integer> {
    YEAR(1, "年"),
    MONTH(2, "月"),
    DAY(3, "日"),
    HOURS(4, "小时"),
    ;

    private int real;

    private String describe;

    private DiscountProductDynamicShelfLifeType(int real, String describe) {
        this.real = real;
        this.describe = describe;
    }

    @Override
    public Integer real() {
        return real;
    }

    @Override
    public String describe() {
        return describe;
    }

    public static DiscountProductDynamicShelfLifeType realValueOf(Integer real) {
        if (Check.notNull(real)) {
            for (DiscountProductDynamicShelfLifeType v : values()) {
                if (v.real().equals(real)) {
                    return v;
                }
            }
        }
        return null;
    }
}
